   





 
/* The Shadow of Social Desirability Bias  */
/* Ding Li, Xiaobo Lu, Shuang Ma, Wenhui Yang */
/* 	May 7, 2025    */
/* STATA 18 */







 clear
graph drop _all
set matsize 5000
set more off








 **********************************************************
****Appendix 
**********************************************************
 
 

 

 global path "F:\Dropbox\Research\PSRM\replication file"

 
 

log using appendix.log, text replace





 *************************************************************
**** Table A-2
**************************************************************
** CFPS, imputated

 cd "$path\data\MI"

***install misest package
/*

1) The package is located in the "mi" folder within the "code" folder.
2)read the "readme" file in the folder, which provides details for installing the package
3)Copy miest.ado, miest.hlp, misum.ado, and misum.hlp to your personal ado directory. 
4)use the "adopath" to check the ado directory, the fifth directory is your personal ado directory  */


 
clear

miest CFPSS logit censored rural age ccp school_yr hukou logfincome  male,nsets(10)


***CFPS, raw

 cd "$path\data"
 
 
 use "CFPS_2014.dta",clear


logit censored rural age ccp school_yr hukou logfincome male
outreg2 using tableA2.doc,  bdec(3) sdec(3) nocons replace


 
 
 
*************************************************************
**** Table A-3
**************************************************************
 cd "$path\data"
 
use "CHFS_2015.dta",clear



 **percentage
  tab trustN0 if treat==0  /*percentage distribution for control group **/ 
  
  tab trustN0 if treat==1 /*percentage distribution for treatment group **/ 
  
  
 **mean
 sum trustN if treat==0  /*mean value for control group **/ 
 
 sum trustN if treat==1 /*mean value for treatment group **/ 
  
  
  
  
 
 
*************************************************************
**** Table A-4
**************************************************************
 cd "$path\data"
 
use "CHFS_2015_full.dta",clear

 **percentage
  tab trustN0 if treat==0  // percentage distribution for control group 
  
  tab trustN0 if treat==1 // percentage distribution for treatment group  
  
  
 **mean
 sum trustN if treat==0 // mean value for control group 
 sum trustN if treat==1 // mean value for treatment group 
  
  
  
 
**********************************************************
****Figure A-1 
**********************************************************
 cd "$path\data"
 
use "CFPS_2014_full.dta",clear



 graph bar, over(trust_cadre)    ///
      ytitle("Percent %",height(5) size(small))    bar(1, fcolor(white) color(black))  ///  
           graphregion(color(white)) ylab(,nogrid) ///
		     title("Full Sample",size(small) color(black)) ///
			  blabel(bar, size(vsmall) format(%4.2f)) ///
			  b1title("Level of Trust",height(5) size(small)) 
	
graph save "f1",replace

 graph bar if overlap==1, over(trust_cadre)    ///
      ytitle("Percent %",height(5) size(small) )   bar(1, fcolor(white) color(black) )  ///  
           graphregion(color(white)) ylab(,nogrid) ///
		     title("74 Overlapping Cities",size(small) color(black)) ///
			  blabel(bar, size(vsmall) format(%4.2f)) ///
			   b1title("Level of Trust",height(5) size(small)) 
			  
graph save "f2",replace	


graph combine f1.gph f2.gph,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(1) 			

graph export "$path\fig_a1.pdf", as(pdf) replace

erase f1.gph
erase f2.gph


 
 
**********************************************************
****Figure A-2 
**********************************************************
 cd "$path\data"
 
use "CFPS_2016_full.dta",clear



 graph bar, over(trust_cadre)    ///
      ytitle("Percent %",height(5) size(small))    bar(1, fcolor(white) color(black))  ///  
           graphregion(color(white)) ylab(,nogrid) ///
		     title("Full Sample",size(small) color(black)) ///
			  blabel(bar, size(vsmall) format(%4.2f)) ///
			  b1title("Level of Trust",height(5) size(small)) 
	
graph save "f1",replace



 graph bar if overlap==1, over(trust_cadre)    ///
      ytitle("Percent %",height(5) size(small) )   bar(1, fcolor(white) color(black) )  ///  
           graphregion(color(white)) ylab(,nogrid) ///
		     title("74 Overlapping Cities",size(small) color(black)) ///
			  blabel(bar, size(vsmall) format(%4.2f)) ///
			   b1title("Level of Trust",height(5) size(small)) 
			  
graph save "f2",replace	


graph combine f1.gph f2.gph,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(1) 			

graph export "$path\fig_a2.pdf", as(pdf) replace

erase f1.gph
erase f2.gph






**********************************************************
****Figure A-3
**********************************************************
 cd "$path\data"
 
**panel A 
clear

import excel "mean.xlsx", sheet("rural") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
(scatter proportion row if group ==3, mcolor(black) msymbol(s) lcolor(black)  lpattern(solid) mlabel(txt_percent ) mlabposition(6)) /// 
, legend(row(1) order(2 "CHFS" 3 "CFPS(MI)" 4 "CFPS" ) pos(6)) /// 
xlabel(3 "Rural" 7 "Urban"  , angle(0) noticks labsize(small)) ///
ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.40 "40%" 0.5 "50%", angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") title("Panel A: Rural/Urban",height(5) size(normarlsize))

graph save "f2a", replace



**panel B
clear

import excel "mean.xlsx", sheet("age") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
(scatter proportion row if group ==3, mcolor(black) msymbol(s) lcolor(black)  lpattern(solid) mlabel(txt_percent ) mlabposition(6)) /// 
, legend(row(1) order(2 "CHFS" 3 "CFPS(MI)" 4 "CFPS" ) pos(6)) /// 
xlabel(3 "18-45" 7 "46+"  , angle(0) noticks labsize(small)) ///
ylabel( 0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.40 "40%" 0.5 "50%", angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") title("Panel B: Age",height(5) size(normarlsize))

graph save "f2b", replace


**panel C
clear

import excel "mean.xlsx", sheet("ccp") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
(scatter proportion row if group ==3, mcolor(black) msymbol(s) lcolor(black)  lpattern(solid) mlabel(txt_percent ) mlabposition(6)) /// 
, legend(row(1) order(2 "CHFS" 3 "CFPS(MI)" 4 "CFPS" ) pos(6)) /// 
xlabel(3 "CCP" 7 "Non-CCP"  , angle(0) noticks labsize(small)) ///
ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.40 "40%" 0.5 "50%", angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") title("Panel C: CCP Membership",height(5) size(normarlsize))

graph save "f2c", replace




**panel D
clear

import excel "mean.xlsx", sheet("college") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
(scatter proportion row if group ==3, mcolor(black) msymbol(s) lcolor(black)  lpattern(solid) mlabel(txt_percent ) mlabposition(6)) /// 
, legend(row(1) order(2 "CHFS" 3 "CFPS(MI)" 4 "CFPS" ) pos(6)) /// 
xlabel(3 "College+" 7 "No College"  , angle(0) noticks labsize(small)) ///
ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.40 "40%" 0.5 "50%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") title("Panel D: Education",height(5) size(normarlsize))

graph save "f2d", replace






**panel E
clear

import excel "mean.xlsx", sheet("hukou") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
(scatter proportion row if group ==3, mcolor(black) msymbol(s) lcolor(black)  lpattern(solid) mlabel(txt_percent ) mlabposition(6)) /// 
, legend(row(1) order(2 "CHFS" 3 "CFPS(MI)" 4 "CFPS" ) pos(6)) /// 
xlabel(3 "Local Hukou" 7 "Non-local Hukou"  , angle(0) noticks labsize(small)) ///
ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.40 "40%" 0.5 "50%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") title("Panel E: Hukou",height(5) size(normarlsize))

graph save "f2e", replace



**panel F
clear

import excel "mean.xlsx", sheet("income") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
(scatter proportion row if group ==3, mcolor(black) msymbol(s) lcolor(black)  lpattern(solid) mlabel(txt_percent ) mlabposition(6)) /// 
, legend(row(1) order(2 "CHFS" 3 "CFPS(MI)" 4 "CFPS" ) pos(6)) /// 
xlabel(3 "Top 20%" 7 "Bottom 20%"  , angle(0) noticks labsize(small)) ///
ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.40 "40%" 0.5 "50%", angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") title("Panel F: Household Income",height(5) size(normarlsize))

graph save "f2f", replace


graph combine f2a.gph f2b.gph f2c.gph f2d.gph f2e.gph f2f.gph ,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(2) 			

graph export "$path\fig_a3.pdf", as(pdf) name("Graph") replace

erase f2a.gph
erase f2b.gph
erase f2c.gph
erase f2d.gph
erase f2e.gph
erase f2f.gph









 
**********************************************************
****Figure A-4 
**********************************************************

 cd "$path\data"

**panel A 
clear

import excel "group_difference.xlsx", sheet("rural") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 6)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS - CFPS" 3 "CHFS - CFPS(MI)" ) pos(6)) /// 
xlabel(2.5 "Rural" 5.5 "Urban"  , angle(0) noticks labsize(small)) ///
ylabel(-0.4 "-40%" -0.3 "-30%" -0.2 "-20%" -0.1 "-10%" 0 "0%" 0.1 "10%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
yline(0, lpattern(dash) lcolor(gs8))  xtitle("") ///
ytitle("Mean Difference of Local Political Trust") title("Panel A: Rural/Urban",height(5) size(normarlsize))

graph save "fa", replace



**panel B
clear

import excel "group_difference.xlsx", sheet("age") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 6)
 
gen p="%"
egen txt_percent = concat(text1 p) 


twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS - CFPS" 3 "CHFS - CFPS(MI)" ) pos(6)) /// 
xlabel(2.5 "18-45" 5.5 "46+"  , angle(0) noticks labsize(small)) ///
ylabel(-0.4 "-40%" -0.3 "-30%" -0.2 "-20%" -0.1 "-10%" 0 "0%" 0.1 "10%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
yline(0, lpattern(dash) lcolor(gs8))  xtitle("") ///
ytitle("Mean Difference of Local Political Trust") title("Panel B: Age",height(5) size(normarlsize))

graph save "fb", replace


**panel C
clear

import excel "group_difference.xlsx", sheet("ccp") firstrow

set scheme s1mono
gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 6)
 
 
gen p="%"
egen txt_percent = concat(text1 p) 


twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS - CFPS" 3 "CHFS - CFPS(MI)" ) pos(6)) /// 
xlabel(2.5 "CCP" 5.5 "Non-CCP"  , angle(0) noticks labsize(small)) ///
ylabel(-0.4 "-40%" -0.3 "-30%" -0.2 "-20%" -0.1 "-10%" 0 "0%" 0.1 "10%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
yline(0, lpattern(dash) lcolor(gs8))  xtitle("") ///
ytitle("Mean Difference of Local Political Trust") title("Panel C: CCP Membership",height(5) size(normarlsize))

graph save "fc", replace




**panel D
clear

import excel "group_difference.xlsx", sheet("college") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 6)
 
gen p="%"
egen txt_percent = concat(text1 p) 


twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS - CFPS" 3 "CHFS - CFPS(MI)" ) pos(6)) /// 
xlabel(2.5 "College+" 5.5 "No College"  , angle(0) noticks labsize(small)) ///
ylabel(-0.4 "-40%" -0.3 "-30%" -0.2 "-20%" -0.1 "-10%" 0 "0%" 0.1 "10%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
yline(0, lpattern(dash) lcolor(gs8))  xtitle("") ///
ytitle("Mean Difference of Local Political Trust") title("Panel D: Education",height(5) size(normarlsize))


graph save "fd", replace






**panel E
clear

import excel "group_difference.xlsx", sheet("hukou") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 6)
 
gen p="%"
egen txt_percent = concat(text1 p) 


twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS - CFPS" 3 "CHFS - CFPS(MI)" ) pos(6)) /// 
xlabel(2.5 "Local Hukou" 5.5 "Non-local Hukou"  , angle(0) noticks labsize(small)) ///
ylabel(-0.4 "-40%" -0.3 "-30%" -0.2 "-20%" -0.1 "-10%" 0 "0%" 0.1 "10%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
yline(0, lpattern(dash) lcolor(gs8))  xtitle("") ///
ytitle("Mean Difference of Local Political Trust") title("Panel E: Hukou",height(5) size(normarlsize))

graph save "fe", replace



**panel F
clear

import excel "group_difference.xlsx", sheet("income") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 6)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  msymbol(o) color(gs8) lpattern(solid) mlabel(txt_percent ) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8) msymbol(d)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS - CFPS" 3 "CHFS - CFPS(MI)" ) pos(6)) /// 
xlabel(2.5 "Top 20%" 5.5 "Bottom 20%"  , angle(0) noticks labsize(small)) ///
ylabel(-0.4 "-40%" -0.3 "-30%" -0.2 "-20%" -0.1 "-10%" 0 "0%" 0.1 "10%" , angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
yline(0, lpattern(dash) lcolor(gs8))  xtitle("") ///
ytitle("Mean Difference of Local Political Trust") title("Panel F: Household Income",height(5) size(normarlsize))


graph save "ff", replace


graph combine fa.gph fb.gph fc.gph fd.gph fe.gph ff.gph ,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(2) 			

graph export "$path\fig_a4.pdf", as(pdf) replace

erase fa.gph
erase fb.gph
erase fc.gph
erase fd.gph
erase fe.gph
erase ff.gph







 *************************************************************
**** Table A-5
**************************************************************
 cd "$path\data"
 
 
 
****Note: The code for results in Columns (1) and (2) is included in the R script file titled "Table A5".


****************************Panel A: Health Insurance*******************************************************
 **health,2014
use "CFPS_2014.dta", clear     

logit trust_cadre_dummy health_insurance logfincome age male school_yr hukou rural ccp
outreg2 using "Table_A5A.doc",keep(health_insurance) se  bdec(3) sdec(3) nocons replace

logit trust_cadre_dummy health_insurance logfincome age male school_yr hukou rural ccp log_pop_10_13 log_gdp_pc_10_13 pro_rural
outreg2 using "Table_A5A.doc", keep(health_insurance) se  bdec(3) sdec(3) nocons append

 **health,2016
use "CFPS_2016", clear

logit trust_cadre_dummy health_insurance logfincome age male school_yr hukou rural ccp
outreg2 using "Table_A5A.doc", keep(health_insurance) se  bdec(3) sdec(3) nocons append

logit trust_cadre_dummy health_insurance logfincome age male school_yr hukou rural ccp log_pop log_gdp_pc pro_rural
outreg2 using "Table_A5A.doc", keep(health_insurance) se  bdec(3) sdec(3) nocons append



****************************Panel B:Pension Insurance*******************************************************

***pension, 2014
 use "CFPS_2014.dta",clear
logit  trust_cadre_dummy pension_insurance logfincome  age  male school_yr hukou rural ccp
outreg2 using "Table_A5B.doc",keep(pension_insurance) se  bdec(3) sdec(3) nocons replace

logit  trust_cadre_dummy pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A5B.doc",keep(pension_insurance) se  bdec(3) sdec(3) nocons append

**pension, 2016
use "CFPS_2016",clear
logit  trust_cadre_dummy pension_insurance logfincome  age  male school_yr hukou rural ccp 
outreg2 using "Table_A5B.doc",keep(pension_insurance) se  bdec(3) sdec(3) nocons append

logit  trust_cadre_dummy pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop  log_gdp_pc pro_rural 
outreg2 using "Table_A5B.doc",keep(pension_insurance) se  bdec(3) sdec(3) nocons append



****************************Panel C: NRPP*******************************************************



***nrps, 2014
 use "CFPS_2014.dta",clear
logit  trust_cadre_dummy NRPP logfincome  age  male school_yr hukou ccp if rural==1
outreg2 using "Table_A5C.doc",keep(NRPP) se  bdec(3) sdec(3) nocons replace

logit  trust_cadre_dummy NRPP logfincome  age  male school_yr hukou ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural if rural==1
outreg2 using "Table_A5C.doc",keep(NRPP) se  bdec(3) sdec(3) nocons append

*nrps, 2016
use "CFPS_2016",clear
outreg2 using "Table_A5C.doc",keep(NRPP) se  bdec(3) sdec(3) nocons append

logit  trust_cadre_dummy NRPP logfincome  age  male school_yr hukou  ccp log_pop  log_gdp_pc pro_rural if rural==1
outreg2 using "Table_A5C.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append




********************************************************************************************
*** Figure A-5
********************************************************************************************** */
 cd "$path\data"
 
use "boot_list_direct",clear


****health_insurance
twoway (kdensity list_coef_health, width(0.05) lpattern(solid)) (kdensity direct_coef_health if direct_coef_health!=0 ,  width(0.05)), scheme(s2mono)  ///
    title("Estimated Coefficients of Health Insurance") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("Estimated Coefficients",size(small)  height(5)) ytitle("Density", height(5))   xline(0, lcolor(red) lpattern(dash)) ylab(,nogrid)  
	
	
graph save "f1", replace	
	
twoway (kdensity list_pvalue_health, width(0.05) lpattern(solid)) (kdensity direct_pvalue_health,  width(0.05)), scheme(s2mono)  ///
    title("P-value of Health Insurance") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("P-value",size(small)  height(5)) ytitle("Density", height(5))   xline(0.1, lcolor(red) lpattern(dash)) ylab(,nogrid)  xlabel(0(0.1)1)
	
graph save "f2", replace	


	
*****pension		

twoway (kdensity list_coef_pension, width(0.05) lpattern(solid)) (kdensity direct_coef_pension,  width(0.05)), scheme(s2mono)  ///
    title("Estimated Coefficients of Pension Insurance") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("Estimated Coefficients",size(small)  height(5)) ytitle("Density", height(5))   xline(0, lcolor(red) lpattern(dash)) ylab(,nogrid)  
	
	
graph save "f3", replace	
	
twoway (kdensity list_pvalue_pension, width(0.05) lpattern(solid)) (kdensity direct_pvalue_pension,  width(0.05)), scheme(s2mono)  ///
    title("P-value of Pension Insurance") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("P-value",size(small)  height(5)) ytitle("Density", height(5))   xline(0.1, lcolor(red) lpattern(dash)) ylab(,nogrid)  xlabel(0(0.1)1)
	
graph save "f4", replace	




***NRPP


twoway (kdensity list_coef_nrpp, width(0.05) lpattern(solid)) (kdensity direct_coef_nrpp if direct_coef_nrpp!=0 ,  width(0.05)), scheme(s2mono)  ///
    title("Estimated Coefficients of NRPP") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("Estimated Coefficients",size(small)  height(5)) ytitle("Density", height(5))   xline(0, lcolor(red) lpattern(dash)) ylab(,nogrid)  
	
	
graph save "f5", replace	
	
twoway (kdensity list_pvalue_nrpp, width(0.05) lpattern(solid)) (kdensity direct_pvalue_nrpp,  width(0.05)), scheme(s2mono)  ///
    title("P-value of NRPP") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("P-value",size(small)  height(5)) ytitle("Density", height(5))   xline(0.1, lcolor(red) lpattern(dash)) ylab(,nogrid)  xlabel(0(0.1)1)
	
graph save "f6", replace	


graph combine f1.gph f2.gph f3.gph f4.gph f5.gph f6.gph  ,altshrink 	graphregion(fcolor(white)) row(3)

graph export "$path\fig_a5.pdf", as(pdf) replace


erase f1.gph
erase f2.gph
erase f3.gph
erase f4.gph
erase f5.gph
erase f6.gph




  *************************************************************
**** Table A-6
************************************************************** 
  cd "$path\data"
  
 use "boot_list_direct",clear
 
 

local varlist   health pension nrpp income corrup
local labellist "Health Insurance" ///
                "Pension Insurance" ///
                "NRPP" ///
                "Income" ///
                "Corruption Investigation"

local nvars : word count `varlist'


matrix T2 = J(2*`nvars', 5, .)

local r = 1   


foreach v of local varlist {

    ttest direct_coef_`v' == list_coef_`v'

    scalar mu1  = r(mu_1)
    scalar mu2  = r(mu_2)
    scalar diff = mu1 - mu2
    scalar tval = r(t)
    scalar pval = r(p)

    scalar se1  = r(sd_1) / sqrt(r(N_1))
    scalar se2  = r(sd_2) / sqrt(r(N_2))


    matrix T2[`r',1] = mu1
    matrix T2[`r',2] = mu2
    matrix T2[`r',3] = diff
    matrix T2[`r',4] = tval
    matrix T2[`r',5] = pval

    local ++r
    matrix T2[`r',1] = se1
    matrix T2[`r',2] = se2

    local ++r
}


matrix rownames T2 = ///
    "Health Insurance" "" ///
    "Pension Insurance" "" ///
    "NRPP" "" ///
    "Income" "" ///
    "Corruption Investigation" ""

matrix colnames T2 = "Direct" "List" "Direct-List" "t-statistics" "p-value"

esttab matrix(T2, fmt(%9.3f)) using "Table_A6.doc", replace mlabels(none) label



  
  
 *************************************************************
**** Table A-7
**************************************************************

 cd "$path\data"
**CFPS 2014, 7/10=1

 use "CFPS_2014.dta",clear


quietly logit  trust_cadre_dummy7 health_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A7.doc", keep(health_insurance) se  bdec(3) sdec(3) nocons replace

quietly logit  trust_cadre_dummy7 pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A7.doc", keep(pension_insurance) se  bdec(3) sdec(3) nocons append

quietly logit  trust_cadre_dummy7  NRPP logfincome  age  male school_yr hukou ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1
outreg2 using "Table_A7.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append



**CFPS 2014, 5/10=1

quietly logit  trust_cadre_dummy5 health_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A7.doc", keep(health_insurance) se  bdec(3) sdec(3) nocons append

quietly logit  trust_cadre_dummy5 pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A7.doc", keep(pension_insurance) se  bdec(3) sdec(3) nocons append

quietly logit  trust_cadre_dummy5 NRPP logfincome  age  male school_yr hukou ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1
outreg2 using "Table_A7.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append





**CFPS, 104,, 0-11

quietly reg trust_cadre0 health_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A7.doc",keep(health_insurance) se  bdec(3) sdec(3) nocons append

quietly reg trust_cadre0 pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A7.doc", keep(pension_insurance) se  bdec(3) sdec(3) nocons append

quietly reg trust_cadre0 NRPP logfincome  age  male school_yr hukou ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1
outreg2 using "Table_A7.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append






 *************************************************************
****Table A-8
**************************************************************
 cd "$path\data\MI"
 
 
***CFPS 2014
clear



miest CFPS logit  trust_cadre_dummy health_insurance  logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural,nsets(10)

miest CFPS logit  trust_cadre_dummy  pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural,nsets(10)

miest CFPS  logit  trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp log_pop_10_13  log_gdp_pc_10_13  pro_rural if rural==1,nsets(10)




***CFPS 2016

clear

miest CFPnew logit  trust_cadre_dummy health_insurance  logfincome  age  male school_yr hukou rural ccp log_pop  log_gdp_pc pro_rural,nsets(10)

miest CFPnew logit  trust_cadre_dummy  pension_insurance logfincome  age  male school_yr hukou rural ccp log_pop  log_gdp_pc pro_rural,nsets(10)

miest CFPnew logit  trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp log_pop  log_gdp_pc  pro_rural if rural==1,nsets(10)










**********************************************************
****Figure A-6
**********************************************************
 cd "$path\data"
 

***The code estimating the results in this figure is included in R script titled "Figure A6"

**health insurance

clear

 set_defaults graphics
 
 
import excel "results.xlsx", sheet("health") firstrow


twoway ///
(rcap low95 high95 row, horiz lcolor(black)) ///  
(scatter row coefficient  if group ==1,  mcolor(black) msize(small) lpattern(solid)  )  /// 
(scatter row coefficient if group ==2, mcolor(black) msize(small) lpattern(solid) lcolor(black)) /// 
(scatter row coefficient if group ==3,  mcolor(black) msize(small) lpattern(solid) lcolor(black)) ///
(scatter  row coefficient if group ==4,   mcolor(black) msize(small) lpattern(solid) lcolor(black)) ///  
(scatter row coefficient if group ==5,   mcolor(black) msize(small) lpattern(solid) lcolor(black)) /// 
, leg(off)  /// 
ylabel(2 "Maximum Likelihood" 3 "Top-coding Error" 4 "Uniform Error" 5"Robust Maximum Likelihood" 6 "Nonlinear Least Square" , angle(0)  labsize(small)) ///
xtitle("Estimated Coefficients",height(5) size(small))  title("Health Insurance", size(small)  color(black))  xlabel(-2(1)2)  ///
ytitle("",height(5))  xline(0, lpattern(dash) lcolor(red)) graphregion(fcolor(white)) ylab(,nogrid)  fxsize(55)


 graph save "f1" , replace





**pension insurance

clear



import excel "results.xlsx", sheet("pension") firstrow


twoway ///
(rcap low95 high95 row, horiz lcolor(black)) /// 
(scatter row coefficient  if group ==1,   mcolor(black) msize(small) lpattern(solid)  )  /// 
(scatter row coefficient if group ==2,  mcolor(black) msize(small) lpattern(solid) lcolor(black)) /// 
(scatter row coefficient if group ==3,  mcolor(black) msize(small) lpattern(solid) lcolor(black)) ///
(scatter  row coefficient if group ==4,   mcolor(black) msize(small) lpattern(solid) lcolor(black)) ///  
(scatter row coefficient if group ==5,   mcolor(black) msize(small) lpattern(solid) lcolor(black)) /// 
, leg(off)  /// 
ylabel(2 "Maximum Likelihood" 3 "Top-coding Error" 4 "Uniform Error" 5"Robust Maximum Likelihood" 6 "Nonlinear Least Square" , angle(0)  labsize(small)) ///
xtitle("Estimated Coefficients",height(5) size(small)) title("Peansion Insurance", size(small)  color(black)) xlabel(-2(1)2) ///
ytitle("",height(5))  xline(0, lpattern(dash) lcolor(red)) graphregion(fcolor(white)) ylab(,nogrid) yscale(lstyle(none)) yscale(range( .)) ylabel(0) 


 graph save "f2" ,   replace


**NRPS

clear



import excel "results.xlsx", sheet("nrps") firstrow


twoway ///
(rcap low95 high95 row, horiz lcolor(black)) /// 
(scatter row coefficient  if group ==1,   mcolor(black) msize(small) lpattern(solid)  )  /// 
(scatter row coefficient if group ==2,  mcolor(black) msize(small) lpattern(solid) lcolor(black)) /// 
(scatter row coefficient if group ==3, mcolor(black) msize(small) lpattern(solid) lcolor(black)) ///
(scatter  row coefficient if group ==4,   mcolor(black) msize(small) lpattern(solid) lcolor(black)) ///  
(scatter row coefficient if group ==5,   mcolor(black) msize(small) lpattern(solid) lcolor(black)) /// 
, leg(off)  /// 
ylabel(2 "Maximum Likelihood" 3 "Top-coding Error" 4 "Uniform Error" 5"Robust Maximum Likelihood" 6 "Nonlinear Least Square" , angle(0)  labsize(small)) ///
xtitle("Estimated Coefficients",height(5) size(small))  title("NRPS", size(small) color(black))   xlabel(-2(1)2)   ///
ytitle("",height(5))  xline(0, lpattern(dash) lcolor(red)) graphregion(fcolor(white)) ylab(,nogrid) yscale(lstyle(none)) yscale(range( .)) ylabel(0) 


 graph save "f3" , replace

 
 graph combine f1.gph f2.gph f3.gph, ycommon graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))	graphregion(fcolor(white)) row(1)  iscale(0.75)
 
 
graph export "$path\fig_a6.pdf", as(pdf) replace


erase f1.gph
erase f2.gph
erase f3.gph
 
 
 
 
 
 
 
 *************************************************************
**** Table A-9
**************************************************************


****The code for results in Columns (1) and (2) is included in the R script file titled "Table A9".

 cd "$path\data"

***CFPS, 2014
 use "CFPS_2014.dta",clear

logit  trust_cadre_dummy  logcorrup_num logfincome  age  male school_yr hukou rural ccp
outreg2 using "Table_A9.doc", keep(logcorrup_num) se  bdec(3) sdec(3) nocons replace

logit  trust_cadre_dummy  logcorrup_num logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural  
outreg2 using "Table_A9.doc",  keep(logcorrup_num) se  bdec(3) sdec(3) nocons append

**CFPS, 2016
use "CFPS_2016.dta",clear

logit  trust_cadre_dummy  logcorrup_num logfincome  age  male school_yr hukou rural ccp 
outreg2 using "Table_A9.doc",  keep(logcorrup_num) se  bdec(3) sdec(3) nocons append

logit  trust_cadre_dummy  logcorrup_num logfincome  age  male school_yr hukou rural ccp log_pop  log_gdp_pc pro_rural  
outreg2 using "Table_A9.doc", keep(logcorrup_num) se  bdec(3) sdec(3) nocons append





 *************************************************************
**** Table A-10
**************************************************************

****The code for results in Columns (1) and (2) is included in the R script file titled "Table A10".

 cd "$path\data"

***CFPS,2014, raw
 use "CFPS_2014.dta",clear

logit  trust_cadre_dummy  logfincome  age  male school_yr hukou rural ccp 
outreg2 using "Table_A10.doc", keep(logfincome) se  bdec(3) sdec(3) nocons replace

logit  trust_cadre_dummy  logfincome  age  male school_yr hukou rural ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural 
outreg2 using "Table_A10.doc", keep(logfincome) se  bdec(3) sdec(3) nocons append


***CFPS,2016, raw
 use "CFPS_2016.dta",clear

logit  trust_cadre_dummy  logfincome  age  male school_yr hukou rural ccp 
outreg2 using "Table_A10.doc", keep(logfincome) se  bdec(3) sdec(3) nocons append

logit  trust_cadre_dummy  logfincome  age  male school_yr hukou rural ccp log_pop  log_gdp_pc pro_rural 
outreg2 using "Table_A10.doc", keep(logfincome) se  bdec(3) sdec(3) nocons append






********************************************************************************************
*** Figure A-7
********************************************************************************************** */

 use "boot_list_direct",clear
 
****income
twoway (kdensity list_coef_income, width(0.05) lpattern(solid)) (kdensity direct_coef_income,  width(0.05)), scheme(s2mono)  ///
    title("Estimated Coefficients of Income") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("Estimated Coefficients",size(small)  height(5)) ytitle("Density", height(5))   xline(0, lcolor(red) lpattern(dash)) ylab(,nogrid)  
	
	
graph save "f1", replace	
	
twoway (kdensity list_pvalue_income, width(0.05) lpattern(solid)) (kdensity direct_pvalue_income,  width(0.05)), scheme(s2mono)  ///
    title("P-value of Income") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("P-value",size(small)  height(5)) ytitle("Density", height(5))   xline(0.1, lcolor(red) lpattern(dash)) ylab(,nogrid)  xlabel(0(0.1)1)
	
graph save "f2", replace	


	
*****corruption investigation	

twoway (kdensity list_coef_corrup, width(0.05) lpattern(solid)) (kdensity direct_coef_corrup,  width(0.05)), scheme(s2mono)  ///
    title("Estimated Coefficients of Corruption Investigation") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("Estimated Coefficients",size(small)  height(5)) ytitle("Density", height(5))   xline(0, lcolor(red) lpattern(dash)) ylab(,nogrid)   xlabel(-1(1)2)
	
	
graph save "f3", replace	
	
twoway (kdensity list_pvalue_corrup, width(0.05) lpattern(solid)) (kdensity direct_pvalue_corrup,  width(0.05)), scheme(s2mono)  ///
    title("P-value of Corruption Investigation") legend(label(1 "List") label(2 "Direct")) graphregion(fcolor(white)) ///
	 xtitle("P-value",size(small)  height(5)) ytitle("Density", height(5))   xline(0.1, lcolor(red) lpattern(dash)) ylab(,nogrid)  xlabel(0(0.1)1)
	
graph save "f4", replace	



graph combine f1.gph f2.gph f3.gph f4.gph   ,altshrink 	graphregion(fcolor(white)) row(2)
graph export "$path\fig_a7.pdf", as(pdf) replace



erase f1.gph
erase f2.gph
erase f3.gph
erase f4.gph






  *************************************************************
**** Figure A-8
************************************************************** 
 
 use "boot_list_direct",clear
 
 
  ttest  direct_coef_income ==list_coef_income
  
  ttest  direct_coef_corrup ==list_coef_corrup

  
clear



import excel "results.xlsx", sheet("diff2") firstrow


twoway ///
(rcap low95 high95 row, vert lcolor(black)) /// 
(scatter coef row if group == 1, lcolor(black) mcolor(black) msize(small) lpattern(solid)) /// 
(scatter coef row if group == 2, lcolor(black) mcolor(black) msize(small) lpattern(solid)) /// 
, leg(off) /// 
xlabel(2 "Income" 3 "Corruption Investigation" , angle(0) labsize(small)) /// 
ytitle("Direct-List Difference", height(5) size(small)) /// 
title("", size(small) color(black)) /// 
ylabel(-0.5(0.5)1.5) xtitle("", height(5)) /// 
graphregion(fcolor(white)) ylab(, nogrid)  yline(0, lpattern(dash) lcolor(red))

graph export "$path\fig_a8.pdf", as(pdf) replace








  *************************************************************
**** Figure A9
**************************************************************

 
  use "CFPS_2014.dta",clear

 quietly reg  trust_cadre_dummy  i.age  logfincome  male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1&age<70&age>50
 
 estimate store m1
 
 


coefplot m1,  mcolor(black) msymbol(S) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash) lcol(black))  ci(95)   ///
           drop(_cons logfincome  male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural )  yline(0)   ytitle("Effect of Age Dummy on Local Political Trust", height(5) size(small)) ///		 
           vertical  legend(off) graphregion(fcolor(white)) bfcolor(none)   ///
		     ylabel(-0.4(0.2)0.4, nogrid angle(vertical) labsize(small)) title("")   xline(9,lpattern(dash)) ///
			coeflabels(52.age="52" 53.age="53" 54.age="54" 55.age="55" 56.age="56" 57.age="57" 58.age="58" 59.age="59"  ///
			60.age="60" 61.age="61" 62.age="62" 63.age="63" 64.age="64" 65.age="65" 66.age="66" 67.age="67" 68.age="68" 69.age="69" , labsize(small) ) 
		

graph export "$path\fig_a9.pdf", as(pdf) replace

 
 
 
 

 
  *************************************************************
**** Table A14
**************************************************************

  cd "$path\data"
  
  use "CFPS_2014.dta",clear


   reg  trust_cadre_dummy  i.age    if rural==1&age<70&age>50
 outreg2 using "Table_A14.doc", se  bdec(3) sdec(3) nocons replace
 
  reg  trust_cadre_dummy  i.age  logfincome  male school_yr hukou ccp   if rural==1&age<70&age>50
 outreg2 using "Table_A14.doc",  drop(logfincome  male school_yr hukou ccp) se  bdec(3) sdec(3) nocons append
 
  reg  trust_cadre_dummy  i.age  logfincome  male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1&age<70&age>50
 outreg2 using "Table_A14.doc",  drop( logfincome  male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural)  se  bdec(3) sdec(3) nocons append




 *************************************************************
**** Table A-15
**************************************************************

  cd "$path\data"
  
  use "CFPS_panel.dta",clear
 

 sort pid year
mi xtset pid year


xtlogit trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp i.year if rural==1,fe
outreg2 using "Table_A15.doc", keep(NRPP) se  bdec(3) sdec(3) nocons replace
 
 
xtlogit trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp log_pop  log_gdp_pc pro_rural i.year if rural==1,fe
outreg2 using "Table_A15.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append
 
xtreg trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp i.year if rural==1,fe
outreg2 using "Table_A15.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append
 
xtreg trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp log_pop  log_gdp_pc pro_rural i.year if rural==1,fe
outreg2 using "Table_A15.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append





   *************************************************************
****Table A-16
**************************************************************
 
 
  cd "$path\data"
 
 use "CFPS_10_12.dta",clear

 


reghdfe support_gov_dummy treat   if rural==1 & age>=60, ab(countyID year) cluster(cntygb)
outreg2 using "Table_A16.doc", keep(treat) se  bdec(3) sdec(3) nocons replace

reghdfe support_gov_dummy treat   logfincome  age  male school_yr  ccp  if rural==1 & age>=60, ab(countyID year) cluster(cntygb)
outreg2 using "Table_A16.doc", keep(treat) se  bdec(3) sdec(3) nocons append


reghdfe support_gov_dummy treat   if rural==1 & age>=60&dup!=0, ab(countyID year) cluster(cntygb)
outreg2 using "Table_A16.doc", keep(treat) se  bdec(3) sdec(3) nocons append

reghdfe support_gov_dummy treat   logfincome  age  male school_yr  ccp  if rural==1 & age>=60&dup!=0, ab(countyID year) cluster(cntygb)
outreg2 using "Table_A16.doc", keep(treat) se  bdec(3) sdec(3) nocons append





   *************************************************************
****Table A-17
**************************************************************
 
  cd "$path\data"
  
 use "CFPS_2014",clear
 
 
 **full sample

  ivreg2   trust_cadre_dummy (NRPP=agedummy )   logfincome  age male school_yr hukou ccp    if rural==1,first
outreg2 using "Table_A17.doc", keep(NRPP) se  bdec(3) sdec(3) nocons replace

   ivreg2   trust_cadre_dummy (NRPP=agedummy )   logfincome  age male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1,first
outreg2 using "Table_A17.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append

   ivreg2   trust_cadre_dummy (NRPP=agedummy )   logfincome  age male school_yr hukou ccp    if rural==1&age<70&age>50,first
outreg2 using "Table_A17.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append

    ivreg2   trust_cadre_dummy (NRPP=agedummy )   logfincome  age male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural   if rural==1&age<70&age>50,first
outreg2 using "Table_A17.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append

    ivreg2   trust_cadre_dummy (NRPP=agedummy )   logfincome  age male school_yr hukou ccp     if rural==1&age<65&age>55,first
outreg2 using "Table_A17.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append

     ivreg2   trust_cadre_dummy (NRPP=agedummy )   logfincome  age male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural   if rural==1&age<65&age>55,first
outreg2 using "Table_A17.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append






 *************************************************************
****Figure A-10
**************************************************************




** ssc install rdrobust  //**install the package if not installed
 
 
 use "CFPS_2014.dta",clear
 

rdplot NRPP agediff if  age<=66&age>=54&rural==1,   c(0) p(1) binselect(qspr)       ///
                    graph_options(title(,size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(0[0.2]1)  ///
                     ytitle("Proportion of NRPS Recipient",size(small)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("", size(small))  graphregion(color(white)))
					
graph export "$path\fig_a10.pdf", as(pdf) replace

 


				
 *************************************************************
****Figure A-11
**************************************************************

 use "CFPS_2014.dta",clear
 
forval i= 3/10{
rdplot trust_cadre_dummy agediff if  age<=60+`i'&age>=60-`i'&rural==1,   c(0) p(1) binselect(qspr)       ///
                    graph_options(title(Satisfaction with local government,size(medsmall))  xline(0) xlabel(-`i'[2]`i') ylabel(0[0.2]1)  ///
                     ytitle("Trust in Local Officials Dummy",size(small)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Bandwidth `i'", size(small))  graphregion(color(white)))
					 graph save Graph "rd`i'.gph", replace

} 
gr combine rd3.gph rd4.gph rd5.gph rd6.gph rd7.gph rd8.gph rd9.gph rd10.gph , subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))	graphregion(fcolor(white)) row(2) 	


					
graph export "$path\fig_a11.pdf", as(pdf) replace

 
 
 
forval i= 3/10{
erase rd`i'.gph
}





 *************************************************************
****Table A-18 
**************************************************************

  cd "$path\data"
  
  
***CFPS, raw
 use "CFPS_2014.dta",clear

 ivreg2   trust_cadre_dummy (NRPP=agedummy agediff)  agediff male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if age<=63&age>=57 &rural==1
outreg2 using "Table_A18.doc", keep(NRPP) se  bdec(3) sdec(3) nocons replace


forval i= 4/10{
ivreg2   trust_cadre_dummy (NRPP=agedummy agediff)  agediff male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if age<=60+`i'&age>=60-`i' &rural==1
outreg2 using "Table_A18.doc", keep(NRPP) se  bdec(3) sdec(3) nocons append
} 






 *************************************************************
****Table A-19
**************************************************************


** ssc install psmatch2


  cd "$path\data"
  
  
***CFPS, raw
 use "CFPS_2014.dta",clear



eststo clear

local calipers "0.001 0.01 0.05"

local j = 1
foreach c of local calipers {

  quietly psmatch2 NRPP logfincome age male school_yr hukou ccp log_pop_10_13 log_gdp_pc_10_13 pro_rural if rural == 1, out(trust_cadre_dummy) neighbor(3) caliper(`c')
		
    scalar att = r(att)
    scalar se  = r(seatt)

    matrix b = (att)
    matrix V = (se^2)

    matrix colnames b = NRPS
    matrix rownames V = NRPS
    matrix colnames V = NRPS

	scalar Ntotal = 8152   
	
    ereturn post b V, obs(`=Ntotal')
    eststo m`j'

    local ++j
}




esttab m1 m2 m3 using "Table_A19.doc", replace b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) ///
    mtitles("Caliper=0.001" "Caliper=0.01" "Caliper=0.05") ///
    coeflabels(NRPS "New Rural Pension Scheme (NRPS)") ///
    stats(N, labels("N") fmt(0)) nonotes
 
 
 
 
 
 
 
log close







